<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="Cache-Control" content="no-store, must-revalidate">
    <meta http-equiv="expires" content="Wed, 26 Feb 1997 08:21:57 GMT">
    <meta http-equiv="expires" content="-1">
    <!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <link rel="shortcut icon" href="/dist/img/icon.png" type="image/x-icon" id="link">
    <title>OA登录</title>

    <!--CSS-->
    <link href="/dist/css/page/login.css?v=1.0" rel="stylesheet"/>
    <script src="https://file.ggxqce.com/web/jquery-2.2.3.min.js"></script><script>window.jQuery || document.write('<script src="/dist/plugins/jQuery/jquery-2.2.3.min.js"><\/script>','<script src="/dist/plugins/bootstrap/js/bootstrap.min.js"><\/script>','<script src="/dist/plugins/vue/vue.min.js"><\/script>')</script>
    <script src="/dist/plugins/jQuery/jquery.cookie.min.js"></script>
    <script src="https://file.ggxqce.com/web/bootstrap.min.js"></script>
    <!--<script src="https://file.ggxqce.com/web/bootstrap.min.js"></script>-->
    <script src="/dist/js/app_iframe.js?t=7e54a132"></script>
    <script src="/dist/js/oa.js?t=54c6b89c"></script>
    <style>
        .goOld{
            position: absolute;
            bottom: -60px;
            left: 40px;
            /* margin-left: -66px; */
            background: #fff;
            width: 240px;
            color: #79b9f6;
            border: 1px solid #79b9f6;
            height: 50px;
            line-height: 50px;
            cursor: pointer;
            text-decoration: blink;
            padding: 0 10px;
            display: none;
        }
        .goOld:hover{
            background: #79b9f6;
            color: #fff;
        }
    </style>
</head>
<body>
<!--沃源-->
<div class="login-container">
    <header class="htmleaf-header">
    </header>
    <div id="wrapper" class="login-page">
        <div id="login_form" class="form">
            <div class="left"><img  src="/dist/img/logo1.png" class="logoImg"/>
                <p style="font-size: 22px;margin-top: 24px;margin-bottom: 10px;color: #dfecfd" class="logoText">G G X Q</p>
            </div>
            <div class="right">
                <form class="login-form">
                    <i class="telIcon"></i><i class="pwdIcon"></i>
                    <input type="text" placeholder="手机号" value="" id="tel"/>
                    <input type="password" placeholder="密码" value="" id="pwd"  />
                    <span id="forgetBtn">忘记密码?</span>
                    <div id="login">登　录</div>
                    <a href="http://60.205.143.20" class="goOld" target="_blank">跳转到旧OA</a>
                </form>
            </div>


        </div>
    </div>
</div>
</body>
<script type="text/javascript">

    if(!urlConfig){
        alert("请使用谷歌浏览器");
    }
    if(server.fwq){
        if(server.fwq=="wyp"){
            document.title = '沃源'

            var linkEle = document.getElementById("link");

            linkEle.href = '/dist/img/ewm-wy.png';

            linkEle.type = '';

            linkEle.type = 'image/x-icon';
            $(".logoImg").attr("src","/dist/img/logo-wy.png")
            $(".logoText").text("S X W Y")
            $(".goOld").show();
        }
    }else{
        document.title = '滚滚向前'
    }
    if($.cookie('loginTel')){$("#tel").val($.cookie('loginTel'))}
    if($.cookie('loginPwd')){$("#pwd").val($.cookie('loginPwd'))}
    function getUrlParamObj() {
        var args = new Object();
        var query = location.href;
        var pairs = query.split("&"); //www.cxybl.com break at ampersand
        for (var i = 0; i < pairs.length; i++) {
            var pos = pairs[i].indexOf('='); // look for "name=value"
            if (pos == -1) continue; // if not found, skip
            var argname = pairs[i].substring(0, pos); // extract the name
            var pos1 = argname.indexOf('?');
            if (pos1 > -1) {
                argname = argname.substring(pos1 + 1);
            }
            var value = pairs[i].substring(pos + 1); // extract the value
            value = decodeURIComponent(value); // decode it, if needed
            args[argname] = value; // store as a property
        }
        var ss = args.valueOf(0);
        obj = args;
        return args; // return the object www.cxybl.com
    }
    $(function () {
        var urlParams = getUrlParamObj();
        if(!urlParams.t){
            if(location.href.indexOf('?')>-1) {
                location.href = location.href + "&t=" + new Date();
            }else{
                location.href = location.href + "?t=" + new Date();
            }
            return;
        }
        if (urlParams.tel) {
            $("#tel").val(urlParams.tel);
        }
        if (urlParams.pwd) {
            $("#pwd").val(urlParams.pwd);
        }
        $("input[type='password']").keypress(function (e) {
            if (event.keyCode == 13) {
                event.cancelBubble = true;
                event.returnValue = false;
                $(this).parents("div").find("#login").click();
            }
        });
        $("#login").click(function () {
            var data = {
                tel: $.trim($('#tel').val()),
                pwd: $.trim($('#pwd').val())
            };
//            if($('#tel').val()!="13934588177"){
//                if(/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)) {
//                    window.location.href = "/page/error.html";
//                }else{
//
//                }
//            }
            $.wyui.postMethod(urlConfig.system.user.login, data, function (r) {
                console.log(r)
                if (r[0]) {
                    if((r[0].companyId=='201804031651473CA771C95F5B8A0ACF'&&server.fwq!='wyp')||(r[0].companyId=='2018041104174574AC1D4939178B2D27'&&server.fwq!='wyp')){
                        alert("您是沃源或辽鞍的用户，正在为您跳转到新OA地址：http://oa.woyuance.cn/page/new.html")
                        location.href = "http://oa.woyuance.com/page/new.html";
                    }else{
                        //记住密码
                        $.cookie("loginTel", data.tel, { expires: 7});
                        $.cookie("loginPwd", data.pwd, { expires: 7 });
                        if (data.pwd === '111111') {
                            setCurrentUser(r[0])
                            location.href = "update_pwd.html?t=" + new Date();
                        } else {
                            setCurrentUser(r[0])
                            location.href = "index.html?t=" + new Date();
                        }
                    }

                } else {
                    alert('用户名或密码错误')
                }
            });
        });
        $("#forgetBtn").click(function () {
            location.href = "getYzm.html?t=" + new Date();
        })
    });
</script>
<script>
console.log("测试")

</script>
</html>
